package io.chenhd.gateway.threadpool;

import io.chenhd.gateway.outbound.httpclient4.NamedThreadFactory;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * Create by chenhd on 2021/8/22.
 */
public class ThreadPool {
    public static ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(Runtime.getRuntime().availableProcessors() * 2
            , Runtime.getRuntime().availableProcessors() * 2
            , 60, TimeUnit.SECONDS
            , new ArrayBlockingQueue<>(1000)
            , new NamedThreadFactory("-nettyThread-")
            , new ThreadPoolExecutor.AbortPolicy());
}
